package com.gl.mapper;

import com.gl.pojo.entity.File;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface FileMapper {
    @Select("SELECT * FROM file WHERE meeting_id = #{meetingId} AND user_id = #{userId}")
    public File getFileInfoByMeetingIdAndUserId(String meetingId, String userId);

    @Insert("INSERT INTO file (id, name, type, description, url, user_id, meeting_id) VALUES " +
            "(#{id}, #{name}, #{type}, #{description}, #{url}, #{userId}, #{meetingId})")
    void insertFile(File file);
}
